// pendingPhotosMagnifyingGlass!
// version 0.9.1
// 2008-09-16
// Copyright (c) 2008, Vincenzo Visciano
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "pendingPhotosMagnifyingGlass", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          pendingPhotosMagnifyingGlass
// @namespace     http://lafraveca.blogspot.com
// @description   
// @include       http://*flickr.com/groups/*/admin/pending/
// @include		  http://flickr.com/groups/*/admin/pending/
//
// Patched by Giulia Riccio. Many thanks!
// @include       http://*flickr.com/groups/*/admin/pending/?page=*
// @include		  http://flickr.com/groups/*/admin/pending/?page=*
//
// ==/UserScript==

(function() {
  var pendingPic = document.getElementsByClassName('pc_img');
  
  var imgObj = '';
   
  for (var i = 0;i < pendingPic.length;++i) {
  	//alert('testo '+i);
  	imgObj += '<img id="glass_'+i+'" style="display:none;position:fixed;bottom:0;right:0px;" src="'+(pendingPic[i].src.substring(0, pendingPic[i].src.length-6) + '.jpg')+'" />';
  	pendingPic[i].id = 'tmpId_'+i;
    pendingPic[i].addEventListener(
      'mouseover',
      function (e){ 
      	var glassobj = document.getElementById('glass'+this.id.substring(this.id.lastIndexOf('_'), this.id.length));
      	glassobj.style.display = 'block';
	  },
    true);

    pendingPic[i].addEventListener(
      'mouseout', function (e){ 
      	var glassobj = document.getElementById('glass'+this.id.substring(this.id.lastIndexOf('_'), this.id.length));
      	glassobj.style.display = 'none';
	  },
    true);
	}
	
	container = document.createElement('div');
	container.zIndex = 1000000;
	container.innerHTML = imgObj;
 	document.body.insertBefore(container, document.body.firstChild);
})();
